import time
from threading import Thread, current_thread


def my_thread(arg1, arg2):
    print(current_thread().getName(), 'start')
    print('%s %s' % (arg1, arg2))
    time.sleep(1)
    print(current_thread().getName(), 'stop')


for i in range(1, 6):
    Thread(target=my_thread, args=(i, i + 1)).start()


class MyThread(Thread):
    """自定义线程类继承Thread，重写run()"""

    def run(self) -> None:
        print(current_thread().getName(), 'start')
        print('run……')
        print(current_thread().getName(), 'stop')

# 主线程输出
print(current_thread().getName(), 'end')
